package com.jfinal.weixin.sdk.utils;

import com.jfinal.weixin.model.WeixinInfo;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by 446705260@qq.com on 16/5/8.
 * chengzhichao
 */
public class StringUtil {
    public static boolean isjiehun(String str) {
        return str.matches("^\u7ed3\u5a5a\u8bc1.*?");
    }
    public static boolean ismb(String str) {
        return str.matches("^mb.*?")||str.matches("^Mb.*?")||str.matches("^MB.*?");
    }
    public static Integer getInteger2(String number) {
        try {
            return Integer.valueOf(number);
        } catch (NumberFormatException e) {
            return 0;
        }
    }
    public static boolean is2016(String str) {
        return str.matches("^2016.*?");
    }

    public static boolean isNum(String str){
        return str.matches("^[-+]?(([0-9]+)([.]([0-9]+))?|([.]([0-9]+))?)$");
    }

    public final static String BKMIMG ="https://mmbiz.qlogo.cn/mmbiz/5O803obudySDAZgfBbOjQ4equiaQOCnRqRY4hcSZKgYnWovu7qgXWCJGzhziaeVIH7JjAvTyaib6YV2mSeN5giavVQ/0?wx_fmt=jpeg";

    public final static String BKMTITLE ="正在开发";

    public final static String BKMDESC ="正在开发";

    public final static String BKMURL ="http://www.0713jc.com/vote";

    public final static String CZC = WeixinInfo.dao.getWeixinInfoById(1).get("adminopenid");

    public final static String HBDESC = "正在开发";

    public final static String HBSM="http://mp.weixin.qq.com/s?__biz=MzIxMTM1OTE3Ng==&mid=100000028&idx=1&sn=d03f41e6bb2df98c9ac6efe9f1cc63ae#rd";

    public final static String getCurTime(){
        Date now = new Date();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String nowtime = sdf.format(now);
        return nowtime;
    }
}
